package com.yungam.imcs.kafka;

import com.yungam.common.bean.alarm.AlarmDto;
import com.yungam.common.service.AlarmService;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;
import java.util.function.Consumer;

//@Component("weldData")
public class DataStreamer implements Consumer<AlarmDto> {

    @Resource
    private AlarmService alarmService;

    @Override
    public void accept(AlarmDto alarmDto) {
        alarmDto.setState(0);
        alarmService.save(alarmDto);
    }

}

